<?php
/**
 * Created by PhpStorm.
 * User: dayu
 * Date: 2019/12/19
 * Time: 15:56
 */

namespace app\Validate;


class LoginValidate extends RequestValidate
{

    protected function rulesList()
    {
        switch ($this->action) {
            //登录
            case 'index':
                return [
                    'account' => 'require|regex:1[0-9]{10}',
                    'password' => 'require',
                    'code' => 'require'
                ];

            case 'decodePhone':
                return [
                    'sessionKey' => 'require|regex:1[0-9]{10}',
                    'password' => 'encryptedData',
                    'code' => 'iv'
                ];

        }
    }

}